<?php
	$query = mysql_query($sql);
	while ($rs = mysql_fetch_array($query, MYSQL_NUM)) {
		$selected = "";
		if ($rs[0] == $selectedId) {
			$selected = "selected";
		}
		echo "<option value='$rs[0]' " . $selected . ">$rs[1]</option>";
	}
?>